package com.db;

public class TestDB {

	/**
	 * 测试 数据库连接信息
	 * @return
	 * 		true：连接正常	<p>
	 * 		false：连接参数错误
	 */
	public static String test(){
		String msg = "OK";
		String sql = "SELECT COUNT(1) FROM T_TOOL ";
		try {

			DataBase db = new DataBase();
			db.preparedStatement = db.conn.prepareStatement(sql);
			db.resultSet = db.preparedStatement.executeQuery();
			while (db.resultSet.next()) {
				String count = db.resultSet.getString(1);
				System.out.println("测试成功【" + count + "】");
			}

		} catch (Exception e) {
			msg = e.getMessage();
		}
		return msg;
	}
}
